package com.sdry.service.hpf;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import com.sdry.model.hpf.LineSideLibrary;
import com.sdry.model.hpf.LineSideLibraryOut;

/**
 * @ClassName: LineSideLibraryService 
 * @Description:线边库Service
 * @Author hpf
 * @Date 2018年9月19日 上午11:30:35 
 * @version 1.0
 */
public interface LineSideLibraryService {

	/**
	 * 线边库总数
	 * @param lineSideLibrary
	 * @return
	 */
	Integer countLineSideLibrary(LineSideLibrary lineSideLibrary);
	
	/**
	 * 分页查询线边库
	 * @param map
	 * @return
	 */
	List<LineSideLibrary> listPageLineSideLibrary(Map<String, Object> map);
	
	/**
	 * 查询所有线边库
	 * @return
	 */
	List<LineSideLibrary> listAllLineSideLibrary();
	
	/**
	 * 叫料批量新增线边库
	 * @param paID 配件ID
	 * @param batch 批次号
	 * @param quantity 数量
	 * @param session
	 * @return
	 */
	Integer insertLineSideLibrary(Long[] paID,String[] batch,String[] quantity,HttpSession session);
	
	/**
	 * 新增线边库
	 * @param paID 配件ID
	 * @param batch 批次号
	 * @param quantity 数量
	 * @param productionOrder 排产单号
	 * @return
	 */
	Integer insert(Long paID,String batch,String quantity, String productionOrder);
	
	/**
	 * 跟新线边库
	 * @param lineSideLibrary 线边库实体
	 * @return
	 */
	Integer updateLineSideLibrary(LineSideLibrary lineSideLibrary);
	
	/**
	 * 根据配件ID查询线边库
	 * @param paID 配件ID
	 * @return
	 */
	LineSideLibrary findLineSideLibraryByPaID(Long paID);
	
	/**
	 * 设置预警值
	 * @param lineSideLibrary 线边库实体
	 * @return
	 */
	Integer setWarningValue(LineSideLibrary lineSideLibrary);
	
	/**
	 * 线边库出库
	 * @param pnum 产品编码
	 * @param quantity 数量
	 * @param quantity 排产单号
	 * @param team 班组名称
	 * @param type 1合格2报废
	 */
	void lineSideLibraryOut(String pnum,String quantity,String productionOrder,String team,String type, HttpSession session);
	
	/**
	 * 线边库盘点
	 * @param lineSideLibraryList
	 * @return
	 */
	Integer lineSideLibraryCheck(List<LineSideLibrary> lineSideLibraryList);
	
	/**
	 * 线边库盘点清空
	 * @param lineSideLibraryList
	 * @return
	 */
	Integer lineSideLibraryEmpty(List<LineSideLibrary> lineSideLibraryList);

	/**   
	 * @Title:newLineSideLibraryOut   
	 * @param pnum
	 * @param quantity
	 * @param productionOrder
	 * @param team
	 * @param type
	 * @param session
	 * @param positionName             
	 */
	void newLineSideLibraryOut(String pnum, String quantity, String productionOrder, String team, String type,
			HttpSession session, String positionName);

	/**   
	 * @Title:twoInsert   
	 * @param paid
	 * @param batch
	 * @param number
	 * @param aplan             
	 */
	Integer twoInsert(Long paid, String batch, String number, String aplan);

	/**   
	 * 根据配件ID在 线边库出库查找数据
	 * @Title:findLineSideLibraryOutByPaID   
	 * @param paid
	 * @return             
	 */
	LineSideLibraryOut findLineSideLibraryOutByPaID(Long paid);
	
}
